﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Threading;
using System.Globalization;
using Nivdal.AuxCode;

namespace Nivdal
{
    public partial class TranslatedNewMatchSentences : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();
            OnlineUser ou = (OnlineUser)Session["User"];

            if (ou.UserAccessLevel == "1" || ou.UserAccessLevel == "0")
            {
                Response.Redirect("~/GeneralMessage.aspx?MessageString=" + ou.UserAccessLevel);
            }

            if (!IsPostBack)
            {
                IgnoreDataSourse.SelectParameters.Add("UserId", ou.UserId);
                SentencesPartsDataSource.SelectParameters.Add("LanguageId", GND.ReadNivdalIntData("UserId", "Nivdal_GetUserTranslateLanguage", ou.UserId));
            }
        }

        protected void UnignoreSentence(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Unignore")
            {
                GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();
                GND.ExecNivdalSQL("IgnoreId", "Nivdal_UnignoreNewMatchSentenceTranslation", e.CommandArgument);
                IgnoredSentencesGridview.DataBind();
            }
        }
    }
}